package com.usefullc.system.query;


import com.usefullc.common.domain.BaseDomain;
import com.usefullc.common.enums.QueryExpressTypeEnum;
import com.usefullc.system.service.component.extend.UsefulQueryField;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;

/**
 * Created by shengshan.tang on 2015/11/27 at 14:12
 */
@Data
public class BaseQuery extends BaseDomain {

    @UsefulQueryField
    @ApiParam(value = "删除状态(0 已删除，1 未删除)",example = "true")
    private Boolean delState = true;

    @UsefulQueryField
    @ApiParam(value = "ID")
    private Long id;

    @ApiParam(value = "页大小")
    private Integer pageSize = 10; // default 10

    @ApiParam(value = "第几页")
    private Integer pageIndex = 1; // 第几页

    @ApiParam(value = "排序字段（多个都好隔开）")
    private String orderByColumn = "id";  //排序字段多个用逗号隔开

    @ApiParam(value = "排序类型desc,asc（多个都好隔开）")
    private String ascOrDesc = "desc"; //排序类型多个用逗号隔开

    @ApiParam(value = "限制条数")
    private Integer resultLimit;

    @UsefulQueryField(columnName = "gmtCreate", format = "%Y-%m-%d",type= QueryExpressTypeEnum.GE)
    @ApiModelProperty(notes = "创建时间开始")
    private String gmtCreateStart;

    @UsefulQueryField(columnName = "gmtCreate", format = "%Y-%m-%d",type= QueryExpressTypeEnum.LE)
    @ApiModelProperty(notes = "创建时间结束")
    private String gmtCreateEnd;

    @UsefulQueryField(columnName = "gmtModified", format = "%Y-%m-%d",type= QueryExpressTypeEnum.GE)
    @ApiModelProperty(notes = "修改时间开始")
    private String gmtModifiedStart;

    @UsefulQueryField(columnName = "gmtModified", format = "%Y-%m-%d",type= QueryExpressTypeEnum.LE)
    @ApiModelProperty(notes = "修改时间结束")
    private String gmtModifiedEnd;

    @ApiModelProperty(notes = "SQL查询包含字段")
    private String includeColumns;

    @ApiModelProperty(notes = "SQL查询排除字段")
    private String excludeColumns;

}
